<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      th:replace="fragments/layout(title='收费项目-修改',jsPaths='/static/js/financial/receipt/edit.js')">
<div class="right" th:fragment="right">
    <!--面包屑-->
    <div class="breadcrumb layui-bg-gray">
                <span class="layui-breadcrumb" lay-separator=">">
                    <a th:href="@{/}">首页</a>
                        <a href="/receipt">收费管理</a>
                        <a href="/receipt">收费项目</a>
                        <a><cite>编辑</cite></a>
                </span>
    </div>

    <!--主体内容区-->
    <div class="form-content">
        <form class="layui-form" th:action="@{/receipt/update}" method="post">
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend>所属老人</legend>
            </fieldset>
            <div class="layui-row">
                <div class="layui-col-md4">
                    <div class="layui-form-item">
                        <label class="layui-form-label">老人姓名</label>
                        <div class="layui-input-block">
                            <input type="text" th:value="${receipt.elderlyName}" name="elderlyName" id="elderlyName" readonly required  lay-verify="required" placeholder="请点击选择老人姓名" autocomplete="off" class="layui-input layui-disabled">
                            <input type="hidden" th:value="${receipt.elderlyId}" name="elderlyId" id="elderlyId">
                            <input type="hidden" name="id" th:value="${receipt.id}">
                            <input type="hidden" name="code" th:value="${receipt.code}">
                            <input type="hidden" name="type" th:value="${receipt.type}">
                        </div>
                    </div>
                </div>
                <div class="layui-col-md4 layui-col-md-offset1">
                    <div class="layui-form-item">
                        <label class="layui-form-label">老人编号</label>
                        <div class="layui-input-block">
                            <input type="text" name="elderlyCode" th:value="${receipt.elderlyCode}" id="elderlyCode" readonly  required  lay-verify="required|only" placeholder="老人编号" autocomplete="off" class="layui-input layui-disabled">
                        </div>
                    </div>
                </div>
            </div>
            <!--<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend>服务项目</legend>
            </fieldset>
            <div class="layui-row">
                <div class="layui-col-md6 layui-col-md-offset1" >
                    <table class="layui-table">
                        <colgroup>
                            <col width="150">
                            <col width="200">
                            <col>
                        </colgroup>
                        <thead>
                        <tr>
                            <th>服务名称</th>
                            <th>服务时间</th>
                            <th>费用</th>
                            <th>选择</th>
                        </tr>
                        </thead>
                        <tbody id="records_tbody">
                            <tr  th:each="d :${recordsList}">
                                <td th:text="${d.itemName}"></td>
                                <td th:text="${#dates.format(d.createdTime, 'yyyy-MM-dd')}"></td>
                                <td class="cost" th:text="${d.cost}"></td>
                                <td>
                                    <div class="layui-input-inline">
                                        <input type="checkbox" name="recordsId" class="recordsId" title="加入收费单"  th:value="${d.id}" checked>
                                    </div>
                                </td>
                            </tr>
                            <tr  th:each="d :${recordsList1}">
                                <td th:text="${d.itemName}"></td>
                                <td th:text="${#dates.format(d.createdTime, 'yyyy-MM-dd')}"></td>
                                <td class="cost" th:text="${d.cost}"></td>
                                <td>
                                    <div class="layui-input-inline">
                                        <input type="checkbox" name="recordsId" class="recordsId" title="加入收费单"  th:value="${d.id}">
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>-->
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend>收费内容</legend>
            </fieldset>
            <div class="layui-row">
                <div class="layui-col-md6 layui-col-md-offset1" >
                    <table class="layui-table">
                        <colgroup>
                            <col width="150">
                            <col width="200">
                            <col>
                        </colgroup>
                        <thead>
                        <tr>
                            <th>套餐名称</th>
                            <th>价格</th>
                        </tr>
                        </thead>
                        <tbody id="items_tbody">
                        <tr th:each="d:${items}" th:if="${d.type eq 3}">
                            <td th:text="${d.name}">
                            </td>
                            <td th:text="${d.monery}">
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend>总计</legend>
            </fieldset>
            <div class="layui-row">
                <div class="layui-col-md3">
                    <div class="layui-form-item">
                        <label class="layui-form-label">收费金额</label>
                        <div class="layui-input-block">
                            <input type="text" name="amount" readonly id="amount" th:value="${receipt.amount}"  required  lay-verify="required|only" placeholder="本次收费总费用" autocomplete="off" class="layui-input layui-disabled">
                        </div>
                    </div>
                </div>
                <!--<div class="layui-col-md3">
                    <div class="layui-form-item">
                        <label class="layui-form-label">服务收费</label>
                        <div class="layui-input-block">
                            <input type="text" name="fwze" id="fwze" readonly  required  lay-verify="required" placeholder="服务项目总费用" autocomplete="off" class="layui-input layui-disabled">
                        </div>
                    </div>
                </div>
                <div class="layui-col-md3">
                    <div class="layui-form-item">
                        <label class="layui-form-label">其它收费</label>
                        <div class="layui-input-block">
                            <input type="text" name="qtze" id="qtze" readonly required  lay-verify="required" placeholder="其它收费总费用" autocomplete="off" class="layui-input layui-disabled">
                        </div>
                    </div>
                </div>-->
            </div>
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend>其它</legend>
            </fieldset>
            <div class="layui-col-md12">
                <div class="layui-col-md6">
                    <div class="layui-form-item">
                        <label class="layui-form-label">收费名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="name" th:value="${receipt.name}" required  lay-verify="required" placeholder="收费名称" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <!--<div class="layui-col-md6">
                    <div class="layui-form-item">
                        <label class="layui-form-label">缴费日</label>
                        <div class="layui-input-inline">
                            <input type="text" name="endTime" id="endTime" th:value="${#dates.format(receipt.endTime,'yyyy-MM-dd')}"  required  lay-verify="required" placeholder="最后缴费日" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">会提醒用户在缴费日前进行缴费</div>
                    </div>
                </div>-->
            </div>



            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn  layui-btn-normal" lay-submit lay-filter="submitBtn">保存</button>
                    <a href="/receipt" class="layui-btn layui-btn-primary">返回</a>
                </div>
            </div>
        </form>

    </div>

    <script id="qtsf" type="text/html">
        <tr>
            <td>
                <input type="text" name="itemsName"    required  lay-verify="required" placeholder="套餐名称" autocomplete="off" class="layui-input ">
            </td>
            <td>
                <input type="text" name="monery" onchange="calcMonery()"   required  lay-verify="required" placeholder="收费金额" autocomplete="off" class="layui-input monery">
            </td>
            <td style="width: 20%">
                <button type="button" class="layui-btn layui-btn-sm" onclick="delRow(this)">删除</button>
            </td>
        </tr>
    </script>
</div>

</html>